Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: auto generate maps for navigation properties / class collections #199

Merged

Conversation

skolmer
Copy link
Contributor

@skolmer skolmer commented Aug 13, 2024

Here is the other PR. This one required some more code changes but I tried to improve test coverage on the way.
Could you publish a new preview release when this is merged?

Description

This PR adds support for automatic map generation of navigation properties / collections of complex types
This also provides a permanent solution for #196 and adds support for all types of collections not just List and Array types.

      var gm = new GridifyMapper<User>(true, 3);
      var users = _dbContext.Users.ApplyFiltering("groups.users.name = test", gm).ToList();

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • I have performed a self-review of my code
  • I have added tests that prove my fix is effective or that my feature works
  • I have made corresponding changes to the documentation
  • I have commented my code, particularly in hard-to-understand areas
  • New and existing unit tests pass locally with my changes

Copy link

what-the-diff bot commented Aug 13, 2024

PR Summary

  • New using statement added in GridifyMapper.cs
    This code will help us access more features related to manipulating data structures, from a library known as 'System.Reflection'.
  • Introduction of ClearMappings() method
    A new function called ClearMappings() has been added to both GridifyMapper.cs and IGridifyMapper.cs. This allows users to clear all existing data mappings, meaning they briefly remove the connection between raw data and the structured format our system uses.
  • Removal of CollectionTypeHelper.cs
    This outdated helper module was deleted as part of this release which was a wise decision as all its tasks have been transferred elsewhere.
  • New Functions in SimpleTypeHelper.cs
    Three new methods - IsCollection, IsSimpleTypeCollection, and IsComplexTypeCollection are added to SimpleTypeHelper.cs to make it easier to categorize data types in our service.
  • New Test Cases introduced
    Several new test cases have been introduced to maintain the quality of the software and to verify the functionality of new implementations. These include ApplyFiltering_NestedProperty, GenerateNestedMappings, and an entirely new test case class named HelperFunctionTests.
  • Additional 'Children' property in TestClass.cs
    This new property will be useful for our testing process as it allows us to model cases where objects within our software contain other objects.

@skolmer skolmer force-pushed the feat/auto-generate-nested-maps branch from 7c76fe2 to 9811f0f Compare August 13, 2024 16:26
Copy link
Owner

@alirezanet alirezanet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, 💐👌 although I haven't fully tested it yet, I'll release another preview version to test it further

@alirezanet alirezanet merged commit 93a1d87 into alirezanet:master Aug 14, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants